﻿using SocketControl.Protocol.Http.Model.General;

namespace SocketControl.Protocol.Http.Model
{
    public class Response : GeneralHeadModel
    {
        public int StatusCode;
        public HttpVersion HttpVersion;
        public string ReasonPhrase;

        public string AcceptRanges;
        public string Age;
        public string ETag;
        public string ProxyAuthenticate;
        public string RetryAfter;
        public string Server;
        public string Trailer;
        public string Vary;
        public string Warning;
        public string WWWAuthenticate;
        public string Location;
        public string Setcookie;
        public string Expires;

        #region Method
        public Response() { }
        public Response(GeneralHeadModel param)
        {
            Cache_Control = param.Cache_Control;
            Connection = param.Connection;
            Date = param.Date;
            Pragma = param.Pragma;
            Transfer_Encoding = param.Transfer_Encoding;
            Via = param.Via;
            Upgrade = param.Upgrade;
            Content_Length = param.Content_Length;
            Content_Type = param.Content_Type;
            Content_Encoding = param.Content_Encoding;
        }
        public Model.GeneralHeadModel GetGeneralBody()
        {
            return new GeneralHeadModel()
            {
                Cache_Control = this.Cache_Control,
                Connection = this.Connection,
                Date = this.Date,
                Pragma = this.Pragma,
                Transfer_Encoding = this.Transfer_Encoding,
                Via = this.Via,
                Upgrade = this.Upgrade,
                Content_Length = this.Content_Length,
                Content_Type = this.Content_Type,
                Content_Encoding = this.Content_Encoding
            };
        }
        #endregion
    }
}
